package Text3;

import java.util.Objects;

/*
 *@Student 张策
 */
public class Employee extends MyDate{
    String name;
    int sal;

    public Employee(int year, int yourse, int day, String name, int sal) {
        super(year, yourse, day);
        this.name = name;
        this.sal = sal;
    }

    @Override
    public boolean equals(Object object) {
        if (this == object) return true;
        if (object == null || getClass() != object.getClass()) return false;
        Employee employee = (Employee) object;
        return Objects.equals(name, employee.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name);
    }

    @Override
    public String toString() {
        return "Employee{" +
                "name='" + name + '\'' +
                ", sal=" + sal +
                ", yourse=" + yourse +
                ", day=" + day +
                '}';
    }
}
